package com.zhehekeji.opsys.api.webservice.server;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import org.apache.cxf.rs.security.cors.CrossOriginResourceSharing;

import com.zhehekeji.opsys.api.resp.CheckActivityResp;
import com.zhehekeji.opsys.api.resp.GetActivityListResp;
import com.zhehekeji.opsys.api.resp.GetActivityResp;
import com.zhehekeji.opsys.api.resp.GetDrawRecordCountByMobileResp;
import com.zhehekeji.opsys.api.resp.GetDrawRecordCountResp;
import com.zhehekeji.opsys.api.resp.GetDrawRecordResp;
import com.zhehekeji.opsys.api.resp.GetPrizeListResp;
import com.zhehekeji.opsys.api.resp.GetWinningResultListResp;
import com.zhehekeji.opsys.api.resp.LuckyDrawResp;
import com.zhehekeji.opsys.api.resp.UpdateWinningResultResp;

/**
 * @ClassName ActivityManager
 * @Description 活动管理接口
 * @author chenweiliu chenwei.liu@163.com
 * @date 2015-4-7   上午10:22:43
 */
@Path(value="/")
@WebService
@CrossOriginResourceSharing(allowAllOrigins=true)
public interface ActivityManager {
	
	@GET
	@Path(value="getActivity")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doGetActivity",operationName="getActivity")
    GetActivityResp getActivity(@WebParam(name="activityCode")@QueryParam(value="activityCode")String activityCode);
	
	@GET
	@Path(value="getActivityList")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doGetActivityList",operationName="getActivityList")
    GetActivityListResp getActivityList(@WebParam(name="cpCode")@QueryParam(value="cpCode")Long cpCode);
	
	@GET
	@Path(value="checkActivity")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doCheckActivity",operationName="checkActivity")
    CheckActivityResp checkActivity(@WebParam(name="activityCode")@QueryParam(value="activityCode")String activityCode);
	
	@GET
	@Path(value="getPrizeList")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doGetPrizeList",operationName="getPrizeList")
	GetPrizeListResp getPrizeList(@WebParam(name="activityCode")@QueryParam(value="activityCode")String activityCode);
	
	@GET
	@Path(value="getWinningResultList")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doGetWinningResultList",operationName="getWinningResultList")
    GetWinningResultListResp getWinningResultList(@WebParam(name="activityCode")@QueryParam(value="activityCode")String activityCode,
                                                  @WebParam(name="firstIndex")@QueryParam(value="firstIndex")int firstIndex,
                                                  @WebParam(name="maxResult")@QueryParam(value="maxResult")int maxResult);
	
	@GET
	@Path(value="getWinningResultListByPrizeCode")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doGetWinningResultListByPrizeCode",operationName="getWinningResultListByPrizeCode")
	GetWinningResultListResp getWinningResultListByPrizeCode(@WebParam(name="prizeCode")@QueryParam(value="prizeCode")String prizeCode,
			@WebParam(name="firstIndex")@QueryParam(value="firstIndex")int firstIndex, 
			@WebParam(name="maxResult")@QueryParam(value="maxResult")int maxResult);
	
	@GET
	@Path(value="getWinningResultListByUserID")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doGetWinningResultListByUserID",operationName="getWinningResultListByUserID")
	GetWinningResultListResp getWinningResultListByUserID(@WebParam(name="userID")@QueryParam(value="userID")String userID,
			@WebParam(name="activityCode")@QueryParam(value="activityCode")String activityCode,
			@WebParam(name="firstIndex")@QueryParam(value="firstIndex")int firstIndex, 
			@WebParam(name="maxResult")@QueryParam(value="maxResult")int maxResult);
	
	
	/*@GET
	@Path(value="luckyDraw")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doLuckyDraw",operationName="luckyDraw")
	LuckyDrawResp luckyDraw(@WebParam(name="activityCode")@QueryParam(value="activityCode")String activityCode,
			@WebParam(name="userID")@QueryParam(value="userID")String userID);*/
	
	@GET
	@Path(value="luckyDraw")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doLuckyDraw",operationName="luckyDraw")
	LuckyDrawResp luckyDraw(@WebParam(name="activityCode")@QueryParam(value="activityCode")String activityCode,
			@WebParam(name="userID")@QueryParam(value="userID")String userID,
			@WebParam(name="limitWinNum")@QueryParam(value="limitWinNum")int limitWinNum);
	
	@GET
	@Path(value="getDrawRecord")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doGetDrawRecord",operationName="getDrawRecord")
	GetDrawRecordResp getDrawRecord(@WebParam(name="activityCode")@QueryParam(value="activityCode")String activityCode,
			@WebParam(name="firstIndex")@QueryParam(value="firstIndex")int firstIndex, 
			@WebParam(name="maxResult")@QueryParam(value="maxResult")int maxResult);
	
	@GET
	@Path(value="getDrawRecordCount")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doGetDrawRecordCount",operationName="getDrawRecordCount")
    GetDrawRecordCountResp getDrawRecordCount(@WebParam(name="activityCode")@QueryParam(value="activityCode")String activityCode,
                                              @WebParam(name="userID")@QueryParam(value="userID")String userID);
	
	@GET
	@Path(value="getDrawRecordCountByMobile")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doGetDrawRecordCountByMobile",operationName="getDrawRecordCountByMobile")
	GetDrawRecordCountByMobileResp getDrawRecordCountByMobile(@WebParam(name="activityCode")@QueryParam(value="activityCode")String activityCode,
			@WebParam(name="mobileNo")@QueryParam(value="mobileNo")String mobileNo);
	
	@GET
	@Path(value="getWinningResultListByMobile")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doGetWinningResultListByMobile",operationName="getWinningResultListByMobile")
	GetWinningResultListResp getWinningResultListByMobile(@WebParam(name="mobileNo")@QueryParam(value="mobileNo")String mobileNo,
			@WebParam(name="activityCode")@QueryParam(value="activityCode")String activityCode,
			@WebParam(name="firstIndex")@QueryParam(value="firstIndex")int firstIndex, 
			@WebParam(name="maxResult")@QueryParam(value="maxResult")int maxResult);
	
	@GET
	@Path(value="updateWinningResult")
	@Produces(value=MediaType.APPLICATION_JSON )
	@WebMethod(action="doUpdateWinningResult",operationName="updateWinningResult")
	UpdateWinningResultResp updateWinningResult(@WebParam(name="winningResultId")@QueryParam(value="winningResultId")Long winningResultId,
			@WebParam(name="mobileNo")@QueryParam(value="mobileNo")String mobileNo);
	
}
